package ModelLayer;


/**
 * Write a description of class Copy here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Copy
{
   public int serialNumber;
   public String purchaseDate;
   public double purchasePrice;
   boolean ok;
   Loan loan;
   
   public Copy(int serialNumber, String purchaseDate, double purchasePrice)
   {
       this.serialNumber = serialNumber;
       this.purchaseDate = purchaseDate;
       this.purchasePrice = purchasePrice;
      ok=true;
    }
    public int getSerialNumber()
    {
        return serialNumber;
    }
    public String getPurchaseDate()
    {
        return purchaseDate;
    }
    public double getPurchasePrice()
    {
        return purchasePrice;
    }
    public boolean getAvailable()
    {
     
            return ok;
            

    }
    public void returned()
    {
        ok=true;
        loan=null;
    }
    public void lent(long loanID, String loanDate, String loanPeriod)
    {
        ok=false;
        loan = new Loan(loanID, loanDate, loanPeriod);
    }
}
